package com.thread.www;

/**
 * Created by 27340 on 2017/3/14.
 */
public class ThreadB implements Runnable{

    public void run() {
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e){
            e.printStackTrace();
        }
        Thread curThread = Thread.currentThread();
        String curThreadName = curThread.getName();
        System.out.println("这是线程的名称 :  " + curThread.getName());
        System.out.println("返回当前线程 " + curThreadName + "的线程组中活动线程的数目 : "+Thread.activeCount());
        System.out.println("返回该线程的" + curThreadName + "的优先级 : " + curThread.getPriority());
        System.out.println("返回该线程的" + curThreadName + "的状态 : " + curThread.getState());
        System.out.println("返回该线程的" + curThreadName + "所属的线程组 : " + curThread.getThreadGroup());
        System.out.println("测试该线程" + curThreadName + "是否处于活动状态 : " + curThread.isAlive());
        System.out.println("测试该线程" + curThreadName + "测试该线程是否为守护线程 : " + curThread.isDaemon());
    }
}
